package com.jython.demo.dao;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;
import java.util.List;

public class WordCount implements WordCountMapper {
    public static SqlSession sqlSession=null;
    public static SqlSessionFactory sqlSessionFactory=null;
    static {
        ClassLoader classloader = Thread.currentThread().getContextClassLoader();
        InputStream is= classloader.getResourceAsStream("SqlMapConfig.xml");
        sqlSessionFactory = new SqlSessionFactoryBuilder().build(is);
        sqlSession = sqlSessionFactory.openSession();
    }
    public int deleteByPrimaryKey(Integer id) {
        return 0;
    }

    public int insert(com.jython.demo.model.WordCount record) {
        return 0;
    }

    public int insertSelective(com.jython.demo.model.WordCount record) {
        return 0;
    }

    public com.jython.demo.model.WordCount selectByPrimaryKey(Integer id) {
        return null;
    }

    public int updateByPrimaryKeySelective(com.jython.demo.model.WordCount record) {
        return 0;
    }

    public int updateByPrimaryKey(com.jython.demo.model.WordCount record) {
        return 0;
    }
    public List<com.jython.demo.model.WordCount> getList(){
        List<com.jython.demo.model.WordCount> wordCounts  = sqlSession.selectList("WordCountMapper.getTest");
        return wordCounts;
    }
}
